﻿CREATE TABLE [dbo].[Contacts]
(
    [Id] BIGINT NOT NULL PRIMARY KEY IDENTITY, 
    [FirstName] NVARCHAR(50) NOT NULL, 
    [LastName] NVARCHAR(50) NOT NULL, 
    [ShippingAddressId] UNIQUEIDENTIFIER NOT NULL, 
    [BillingAddressId] UNIQUEIDENTIFIER NOT NULL, 
    [Phone] NCHAR(11) NULL, 
    [Email] NVARCHAR(255) NULL, 
    [DateCreated] DATETIME NOT NULL DEFAULT GetDate(), 
    [DateModified] DATETIME NOT NULL DEFAULT GetDate(), 
    [DateDeleted] DATETIME NULL, 
    CONSTRAINT [FK_Contacts_Address1] FOREIGN KEY ([ShippingAddressId]) REFERENCES [Addresses]([Id]),
    CONSTRAINT [FK_Contacts_Address2] FOREIGN KEY ([BillingAddressId]) REFERENCES [Addresses]([Id])
)

GO
